import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from './store'
import TypeNav from './components/TypeNav'
import Carousel from './components/Carousel'
import Pagination from './components/Pagination'
import '@/mock/serve'
import 'swiper/css/swiper.css'
import * as API from '@/api'
import '@/plugins/validate'
// 图片懒加载
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload)
import erha from '@/assets/images/1.gif';
//Vue.use的时候，这个插件给咱们提供一个全局指令v-lay
Vue.use(VueLazyload, {
  //设置图片懒加载默认图片
  loading: erha,
});
import { MessageBox } from 'element-ui';

Vue.component('TypeNav',TypeNav)
Vue.component('Carousel',Carousel)
Vue.component(Pagination.name,Pagination)
Vue.config.productionTip = false;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

new Vue({
  render: h => h(App),
  beforeCreate(){
      Vue.prototype.$bus = this
      Vue.prototype.$API = API
  },
  router,
  store
}).$mount('#app')
